package com.yyc.utils.poi;

import java.util.List;

import com.yyc.system.model.TUser;

import cn.hutool.core.io.FileUtil;
import cn.hutool.poi.excel.ExcelReader;
import cn.hutool.poi.excel.ExcelUtil;

public class POIUtils {
	
	/**
	 * 将excal中的数据读到实体bean中
	 */
	public static List<?> readExcal2Bean(Class<?> clazz,String filePath) {
		System.out.println(clazz);
		ExcelReader reader = ExcelUtil.getReader(FileUtil.file(filePath));
		List<?> list = reader.readAll(clazz);
		System.out.println(list);
		return list;
	}
	
	public static void main(String[] args) {
		POIUtils.readExcal2Bean(TUser.class,"C:\\\\Users\\\\Administrator\\\\Desktop\\\\user.xlsx");
	}

}
